<template>
	<view class="top_container">
		<image src="/static/mine/register_logo.png" mode="aspectFill" style="width: 244rpx;height: 204rpx;margin-top: 100rpx;"></image>
		<text class="company_title">欢迎使用隆宇电力智慧管理平台</text>
	</view>
</template>

<script>
	import BaseUserInfo from '@/user/baseUserInfo.js';
	export default {
		data() {
			return {};
		},
		onLoad() {
			console.log("onload");
			let self = this
			setTimeout(() => {
				self.checkNewLogin()
			}, 200);
		},
		methods:{
			checkNewLogin(){
				// #ifdef MP-WEIXIN
				this.$progressHud.showLoading();
				this.$weixinAuth.isLogined().then(ok=>{
					if(!ok) {
						this.$weixinAuth.login().then(ok=>{
							this.$progressHud.hideLoading();
							if(ok.hasUserInfo) {
								this.$Router.pushTab("/pages/tabBar/home/home");
							} else {
								this.$Router.pushTab("/pages/tabBar/product/product");
							}
						},fail=>{
							this.$progressHud.hideLoading();
							this.$Router.pushTab("/pages/tabBar/product/product");
						})
					} else {
						this.$progressHud.hideLoading();
						this.$Router.pushTab("/pages/tabBar/home/home");
					}
				})
				// #endif
				
				// #ifdef H5
				this.$Router.pushTab('/pages/tabBar/home/home')
				// #endif
			}
		}
	};
</script>

<style scoped>
	page {
		width: 100%;
		height: 100%;
		background-color: #FFFFFF;
	}

	.top_container {
		display: flex;
		flex-direction: column;
		text-align: center;
		width: 100%;
		height: 100%;
		
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-start;
		background-color: #FFF;
	}

	.company_title{
		font-size: 36rpx;
		font-weight: normal;
		line-height: 56rpx;
		text-align: center;
		letter-spacing: normal;
		color: #4B5563;
		
		margin-top: 10rpx;
	}
</style>
